@extends('backend::layout')

@section('title', '添加学生信息')

@section('content')
    <form method="post">
        {{ csrf_field() }}
        <div class="box box-primary">
            <div class="box-header with-border">
                <div class="col-lg-4">
                    <h3 class="box-title">添加评测信息</h3>
                </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body pad-10">
                <div class="col-lg-4">
                    <div class="form-group">
                        <label class="control-label">学生姓名</label>

                        <div class="form-control">{{ $child->name }}</div>
                    </div>
                </div>
                <div class="col-lg-4">
                    <div class="form-group @if($errors->has('tool')) has-error @endif">
                        <label class="control-label">评估工具/量表</label>
                        <input class="form-control " name="tool" type="text" placeholder="评估工具/量表" value="{{ old('tool') }}">
                        @if($errors->has('tool'))
                            <span class="help-block">{{ $errors->first('tool') }}</span>
                        @endif
                    </div>
                </div>

                <div class="col-lg-4">
                    <div class="form-group @if($errors->has('age')) has-error @endif">
                        <label class="control-label">生理年龄</label>
                        <input class="form-control " name="age" type="text" placeholder="生理年龄" value="{{ old('age') }}">
                        @if($errors->has('age'))
                            <span class="help-block">{{ $errors->first('age') }}</span>
                        @endif
                    </div>
                </div>
                <div class="col-lg-4">
                    <div class="form-group @if($errors->has('agedevelop')) has-error @endif">
                        <label class="control-label">评估发展年龄</label>
                        <input class="form-control " name="agedevelop" type="text" placeholder="评估发展年龄" value="{{ old('agedevelop') }}">
                        @if($errors->has('agedevelop'))
                            <span class="help-block">{{ $errors->first('agedevelop') }}</span>
                        @endif
                    </div>
                </div>

                <div class="col-lg-4">
                    <div class="form-group">
                        <label class="control-label">评测阶段</label>
                        <div class="radio">
                            <label>
                                <input type="radio" value="0" @if(old('stage') === null || old('stage') == 0) checked @endif name="stage">
                                {{$stage[0]}}
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" value="1" @if(old('stage') !== null && old('stage') == 1) checked @endif name="stage">
                                {{$stage[1]}}
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" value="2" @if(old('stage') !== null && old('stage') == 2) checked @endif name="stage">
                                {{$stage[2]}}
                            </label>
                        </div>
                        @if($errors->has('stage'))
                            <span class="help-block text-danger">{{ $errors->first('stage') }}</span>
                        @endif
                    </div>
                </div>
                <div class="col-lg-4">
                    <div class="form-group @if($errors->has('assess_time')) has-error @endif">
                        <label class="control-label">评估时间</label>
                        <div class="input-group date form_date" data-date="" data-date-format="yyyy-mm-dd HH:ii:ss" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd HH:ii:ss">
                            <input class="form-control" size="16" type="text" name="assess_time" value="{{ old('assess_time') }}" readonly>
                            <span class="input-group-addon"><span class="fa fa-lg fa-calendar"></span></span>
                        </div>
                        @if($errors->has('assess_time'))
                            <span class="help-block">{{ $errors->first('assess_time') }}</span>
                        @endif
                    </div>
                </div>
            </div>

            <!-- /.box-body -->
            <div class="box-footer m-b-2">
                <div class="col-lg-4">
                    <button class="btn btn-primary btn-sm" type="submit">
                        <i class="fa fa-check"></i> {{ __('Save') }}
                    </button>
                    &nbsp;&nbsp;&nbsp;
                    <a class="btn btn-default btn-sm" href="javascript:history.back(-1);">
                        <i class="fa fa-undo"></i> {{ __('Back') }}
                    </a>
                </div>
            </div>
            <!-- /.box-footer -->
        </div>
    </form>
@stop

@section('script')
    <script>
        !function ($) {
            $(function () {
                $('.form_date').datetimepicker({
                    language:  'zh-CN',
                    weekStart: 1,
                    todayBtn:  1,
                    autoclose: 1,
                    todayHighlight: 1,
                    startView: 2,
                    minView: 2,
                    forceParse: 0
                });
            });
        }(jQuery);

    </script>
@stop